package com.example.utils;

import com.example.login.entity.dto.EmployeeDto;
import com.example.user.entity.User;



public class UserHolder {
    private static final ThreadLocal<EmployeeDto> tl = new ThreadLocal<>();

    private static final ThreadLocal<User> tl1 = new ThreadLocal<>();

    public static void saveEmployeeDto(EmployeeDto employeeDto){
        tl.set(employeeDto);
    }

    public static void saveUser(User user){
        tl1.set(user);
    }

    public static EmployeeDto getEmployeeDto(){
        return tl.get();
    }

    public static User getUser(){
        return tl1.get();
    }

    public static void removeEmployeeDto(){
        tl.remove();
    }
}
